<template>
    <div>
        <el-dialog
                v-if="currentData != null"
                title="提示"
                :visible.sync="dialogVisible"
                width="30%"
                :before-close="handleClose">
            <el-descriptions class="margin-top" title="报名信息" :column="3" size="small" border>
                <el-descriptions-item>
                    <template slot="label">
                        <i class="el-icon-user"></i>
                        姓名
                    </template>
                    {{currentData.name}}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">
                        <i class="el-icon-mobile-phone"></i>
                        手机号
                    </template>
                    {{currentData.phone}}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">
                        <i class="el-icon-location-outline"></i>
                        机构名称
                    </template>
                    {{currentData.org.org_name}}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">
                        <i class="el-icon-tickets"></i>
                        报考科目
                    </template>
                    <el-tag size="small">{{currentData.course.name}}</el-tag>
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">
                        <i class="el-icon-office-building"></i>
                        证件号码
                    </template>
                    {{currentData.card_id}}
                </el-descriptions-item>
            </el-descriptions>
            <span slot="footer" class="dialog-footer">
    <el-button type="danger" @click="orgReject">驳回</el-button>
    <el-button type="success" @click="orgCheck">通过</el-button>
  </span>
        </el-dialog>
    </div>
</template>

<script>
    import {check} from "../../../request/api";
    export default {
        name: "check",
        props:{
            currentData:{}
        },
        methods:{
            handleClose(done) {
                done();
            },
            orgCheck() {
                let params = {pid: this.currentData.id, method: 'org_pass_1'};
                console.log(params);
                check(params).then(res => {
                    console.log(res);
                })
            },
            orgReject() {
                this.$prompt('请输入驳回原因', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                }).then(({value}) => {
                    this.$message({
                        type: 'success',
                        message: '提交成功'
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消'
                    });
                });
            },
        }
    }
</script>

<style scoped>

</style>
